<?php 
if ($result instanceof sfOutputEscaperArrayDecorator)
    echo json_encode($result->getRawValue());
else
	echo json_encode($result);
?>